﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace MainFrame
{
    [Serializable]
    public class ConfigData
    {
        /// <summary>
        /// 下层检测物料时间
        /// </summary>
        public int downProTime_In { get; set; }
        public int downProTime_out { get; set; }
        public bool IsLabelResultOk { get; set; }
        public bool isPosOk { get; set; }
        public bool IsWordOk { get; set; }
        public string CameraSN_pos { get; set; }
        public string CameraSN_draw { get; set; }
        public string CameraSN_check { get; set; }
        public List<PlateVisionInfo> PlateVisionList { get; set; }
        public List<Cmd> cmdList { get; set; }

        public string db_IP { get; set; }
        public string db_UserName { get; set; }
        public string db_Password { get; set; }
        public string db_Name { get; set; }
        public string db_T_Product { get; set; }
        public string db_T_Alarm { get; set; }
        public string db_T_Status { get; set; }
        public bool IsAutoFly { get; set; }
        public bool isEnableVisionsyr { get; set; }
        public int clampTime { get; set; }
        public int airTime { get; set; }
        /// <summary>
        /// 启用与上层上下游信号对接
        /// </summary>
        public bool isEnableUpSignal { get; set; }
        /// <summary>
        /// 启用与下层上下游信号对接
        /// </summary>
        public bool isEnableDownSignal { get; set; }
        /// <summary>
        /// 双平台分开取标
        /// </summary>
        public bool IsGetLabelTwo { get; set; }
        /// <summary>
        /// 数据上次信息
        /// </summary>
        public UrlInfo UploadInfo { get; set; }
        public double NG_distance { get; set; }
        /// <summary>
        /// 延时拍照
        /// </summary>
        public int delayCamera { get; set; }
        /// <summary>
        /// 拍照NG次数
        /// </summary>
        public int CameraNGTime { get; set; }
        /// <summary>
        /// 取标NG次数
        /// </summary>
        public int getLabelNGTimes { get; set; } = 3;
        /// <summary>
        /// 
        /// </summary>
        public int getFlyNGTimes { get; set; } = 3;
        public int WrodAlarm { get; set; } = 1;
        public int NoLabel { get; set; } = 1;
        public bool PickCheck { get; set; } = true;
        /// <summary>
        /// 屏蔽飞达+默认取模成功
        /// </summary>
        public bool IsGetLabelOK { get; set; }
        /// <summary>
        /// 气缸未到位重复次数
        /// </summary>
        public int airRepeatTime { get; set; }
        /// <summary>
        /// 气缸未到位重复间隔时间
        /// </summary>
        public int airInterval { get; set; }
        /// <summary>
        /// 强制贴标完成+贴标OK
        /// </summary>
        public bool isLabelFinishOK { get; set; }
        /// <summary>
        /// 强制镭雕完成+镭雕OK
        /// </summary>
        public bool isCutFinishOK { get; set; }
        /// <summary>
        /// 先定位再贴标
        /// </summary>
        public bool IsPosAfterLabel { get; set; }
        /// <summary>
        /// 下层放行延时
        /// </summary>
        public int DelayCheck_Down { get; set; }
        /// <summary>
        /// 检测撕膜效果
        /// </summary>
        public bool IsCheckCutResult { get; set; }
        public int airCutTime { get; set; }
        /// <summary>
        /// 治具在位过滤时间
        /// </summary>
        public int CutKeepTime { get; set; }
        public int deleyNGair { get; set; }
        /// <summary>
        /// 膜检测过滤时间
        /// </summary>
        public int LabelKeepAirTime { get; set; }
        public int dis_ConveryReset { get; set; }
        public int deleyNGRotate { get; set; }
        public int deleyNGup { get; set; }
        public Box_RFID RFIDBox { get; set; }
        /// <summary>
        /// 取标NG自动处理次数
        /// </summary>
        public int getLabelNGTimes_auto { get; set; }
        /// <summary>
        /// 下层送出治具超时报警
        /// </summary>
        public int downAlarmOut { get; set; }
        /// <summary>
        /// 下层收到下料信号后延时检查物料
        /// </summary>
        public int downDelayArivel { get; set; }
        /// <summary>
        /// 下层输送自动处理时间
        /// </summary>
        public int downAutoTime { get; set; }
        /// <summary>
        /// 送料完后阻挡加延时检查载具感应器
        /// </summary>
        public int downDelayBlock { get; set; }
        public int ConveryOpen_time { get; set; }
        public int ConveryReset_time { get; set; }
        public int TimeOut_In { get; set; }=100000;
        public int delayLift2 { get; set; }
        public int delayBlock2 { get; set; }
        public int delayBlock1 { get; set; }
        /// <summary>
        /// 一段离开超时报警
        /// </summary>
        public int TimeOut_Leave1 { get; set; }
        public bool IgnoreFrontSignal { get; set; } = false;


        //增加海康视觉标定标志位
        public double CalibrationXY { get; set; }//标定XY间隔
        public double CalibrationAngle { get; set; }//标定角度
        public bool Vision_En { get; set; }//视觉开启关闭

        //增加海康视觉XYA补偿
        public double LeftFitCompensationX { get; set; }//
        public double LeftFitCompensationY { get; set; }//
        public double LeftFitCompensationA { get; set; }//

        public double RightFitCompensationX { get; set; }//
        public double RightFitCompensationY { get; set; }//
        public double RightFitCompensationA { get; set; }//

        //上相机拍照延时
        public int Camera_wait { get; set; }//
    }

    public class Box_RFID
    {
        public string have_R { get; set; }
        public string have_O { get; set; }
        public string have_P { get; set; }
        public string have_N { get; set; }
        public string NGflag { get; set; }
        public int have_OPRNcount { get; set; }
        /// <summary>
        /// 启用统一RFID
        /// </summary>
        public bool IsEnableRFID { get; set; }
        /// <summary>
        /// 启用读写
        /// </summary>
        public bool IsEnable { get; set; }
        /// <summary>
        /// NG
        /// </summary>
        public string NGNG { get; set; }
        /// <summary>
        /// NG后恢复OK
        /// </summary>
        public string NGOK { get; set; }
        /// <summary>
        /// 人工过站
        /// </summary>
        public string MR { get; set; }
        /// <summary>
        /// 自动人工过站
        /// </summary>
        public string MR_Auto { get; set; }
        /// <summary>
        /// OK
        /// </summary>
        public string OK { get; set; }
        /// <summary>
        /// 站名
        /// </summary>
        public string station { get; set; }
        /// <summary>
        /// 多次读取
        /// </summary>
        public int nReadTimes { get; set; }
        /// <summary>
        /// 多次写入
        /// </summary>
        public int nWriteTimes { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string have_string { get; set; }
        public string in_COM { get; set; }
        public int in_Baudrate { get; set; }
        public string out_COM { get; set; }
        public int out_Baudrate { get; set; }
    }
    public enum e_RFIDPlate
    {

        产品2 = 0,
        产品1,
    }
}
